<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <!-- header -->
    <%@ include file="/WEB-INF/views/include/header.jsp" %>
    <link rel="stylesheet" href="<s:url value="/assets/css/main.css"></s:url>"/>
</head>
<style>
    #laydate_today {
        display: none !important;
    }
    .title{
        width: 100%;
        height: 120px;
        margin: 20px auto;
    }
    .title_div1,.title_div2,.title_div3{
        width: 100%;
        height: 40px;
        text-align: left;
        line-height: 40px;
    }
    .title_div4{
        width: 100%;
        text-align: left;
        margin-top: 10px;
    }
</style>
<body class="no-skin">
<%--上传成功模态框--%>
<div class="shade" style="display: none;"></div>
<div class="warning" style="display: none;">
    <p class="title"><em></em><span class="close">X</span></p>
    <p class="cont"></p>
    <div class="la-square-jelly-box la-3x">
        <div></div>
        <div></div>
    </div>
</div>



<!-- /section:basics/navbar.layout -->
<div class="main-container" id="main-container">
    <!-- /section:basics/sidebar -->
    <div class="main-content">
        <div class="main-content-inner">
            <div class="page-content">
                <!-- /section:settings.box -->
                <h3 class="text-center">《${projectDetail.projectName}》填报详情</h3>

                <div class="title container">
                    <div class="title_div1 row">
                        <div class="text1 col-xs-5	col-sm-3	col-md-2	col-lg-1">责任领导：</div>
                        <div class="text2 col-xs-7	col-sm-9	col-md-10	col-lg-11">${projectDetail.leaderName}</div>
                    </div>
                    <div class="title_div2 row">
                        <div class="text1 col-xs-5	col-sm-3	col-md-2	col-lg-1">责任单位：</div>
                        <div class="text2 col-xs-7	col-sm-9	col-md-10	col-lg-11">${zeren}</div>
                    </div>

                    <div class="title_div3 row">
                        <div class="text1 col-xs-5	col-sm-3	col-md-2	col-lg-1">备注：</div>
                        <div class="text2 col-xs-7	col-sm-9	col-md-10	col-lg-11">${projectDetail.remarks}</div>
                    </div>
                   <%-- <div class="form-group clearfix title_div4 row">
                        <div class="text1 col-xs-5	col-sm-3	col-md-2	col-lg-1">附件下载：</div>
                        <div class="text2 col-xs-7	col-sm-9	col-md-10	col-lg-11" style="padding-bottom: 30px">
                            <c:if test="${not empty taskMain.files}">
                                <c:forEach items="${taskMain.files}" var="fileMap">
                                    <div style="margin-bottom:15px;">
                                        <input style="width: 50%;" type="text" class="fileName" readonly
                                               title="${fileMap.fileName}"
                                               value="${fileMap.fileName}" onclick="copyFile(this)">
                                        <button class="btn btn-primary file" onclick="download(this)"
                                                FileSysId="${fileMap.file}">
                                            下载附件
                                        </button>
                                    </div>
                                </c:forEach>
                            </c:if>
                            <c:if test="${empty taskMain.mainResultFile}">
                                <input style="width: 50%;" type="text" value="无附件" class=" col-sm-3 form-control" readonly>
                            </c:if>
                        </div>
                </div>--%>

                    <%--<div class="title_div2 row" style="margin-bottom: 120px;">
                        <div class="text1 col-xs-6	col-sm-4	col-md-3	col-lg-2"  onclick="lookMore()"> <a id="look_more" href="javascript:;">查看子事项</a> </div>
                        <div class="text2 col-xs-6	col-sm-8	col-md-9	col-lg-10"></div>
                    </div>--%>
                    <%--<div class="title_div3 row">
                        <c:if test="${not empty taskUnit}">
                            <c:forEach items="${taskUnit}" var="listUnit">
                                <div class="text1 col-xs-5	col-sm-3	col-md-2	col-lg-1 the_title_look_more" >子事项：</div>
                                <div class="text2 col-xs-7	col-sm-9	col-md-10	col-lg-11 the_look_more"  >${listUnit.taskSubName}---->${listUnit.unitType=='1'?'牵头单位':'协办单位'}：${listUnit.deptName}</div>
                            </c:forEach>
                        </c:if>

                    </div>--%>


                </div>

                <div id="projectId" style="display: none" >
                  ${projectId}
                </div>




                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <!-- jqGrid表格 -->
                        <table id="gridTable"></table>
                        <!-- jqGrid工具类 -->
                        <div id="gridPager"></div>
                        <!-- 查询对话框 -->
                        <div style="display: none;">
                            <div class="row" id="queryDialog"></div>
                        </div>
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->

<%--                <h4 class="redTips">温馨提示：双击表格行或者点击"查看详情" 查看任务列表</h4>--%>
            </div>
        </div><!-- /.main-content -->

        <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
            <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
        </a>

        <%@ include file="/WEB-INF/views/include/dialog.jsp" %>
    </div><!-- /.main-container -->
</div>




<!-- footer -->
<%--多选上传--%>
<script src="<s:url value="/assets/js/dist/easyUploader.jq.js"></s:url>"></script>
<%@ include file="/WEB-INF/views/include/footer.jsp" %>

<script type="text/javascript">
    // 基本路径
    var baseUrl = "<s:url value="/sys/gongjian/projectTasks/own"></s:url>"

    // jqgrid的表格高度
    var height = 320;
    // jqgrid表格行头的中文
    var colNames = ['','操作', '任务名称','填报截止期限','审核状态',"填报时间",'反馈账号','形象进度','完成率', '预计月底能否达本月节点目标', '10月当期投资额','8月至10月总投资额',"备注（未达标备注）", '是否竣工'/*"预估8月至本月底合计完成投资(亿)"*/];//我派发的任务\

    //我的任务表
    var colModel = [
        {name: 'sysId', width: 60, hidden: true, key: true},
        {name: 'sy', width: 60, align: "center", formatter: feedbackBtnFormatter},
        {name: 'taskName', index: 'taskName', width: 350, editable: true},
        {name: 'taskEndDate', index: 'taskEndDate', width: 140, editable: true},
        {name: 'audit', index: 'audit', width: 90, editable: true,formatter:auditFormatter},
        {name: 'createDate', index: 'createDate', width: 160, editable: true},
        {name: 'createName', index: 'createName', width: 100, editable: true},
        {name: 'xingxiang', index: 'xingxiang', width: 250, editable: true},
        {name: 'completion', index: 'completion', width: 100, editable: true,formatter:comFormat},

        {name: 'reachoals', index: 'reachoals', width: 200, editable: true,formatter: reahchFormatter},
        {name: 'currentValue', index: 'currentValue', width: 130, editable: true},
        {name: 'totalValue', index: 'totalValue', width: 130, editable: true},
        {name: 'remarks', index: 'remarks', width: 150, editable:                       true},
        {name: 'jungongState', index: 'jungongState', width: 150, editable: true,formatter: reahchFormatter},
        // {name: 'addCurrentValue', index: 'addCurrentValue', width: 230, editable:           true},


    ];

    var rowIds;
    // jqgrid的具体执行方法
    jqgrid({
        gridTableId: "#gridTable",
        gridPagerId: "#gridPager",
        postData: {'projectId': $('#projectId').html().trim(),'projectType':4},
        autoScroll: true,
        shrinkToFit: true,
        multiselect: false,
        rownumbers: true,
        grouping:true,
        sortname:'taskName',
        groupingView : {
            groupField : ['taskName'],
            groupColumnShow : [false],
            groupText:['任务名：'+'<b>{0}</b>']
        },
        onSelectRow: function (rowid, status) {
            rowIds = rowid;
            //选择当前的行
            var selectedRowValue = $("#gridTable").jqGrid('getRowData', rowid);
            var types = selectedRowValue.type;//获取任务状态

        },
        loadComplete: function (data) {

        },
        onSelectAll: function (aRowids, status) {

        },
        gridComplete: function () {

        },
        ondblClickRow: function (rowid) {


        }
    });

    function comFormat(value) {
        if(value==0){
            return "-";
        }else {
            return value+"%"
        }
    }

    function  auditFormatter(value){
        switch (value) {
            case 0:
                return "未审核";
            case 1:
                return "审核通过";
            case 2:
                return "审核不通过";

        }
    }

    function reahchFormatter(value) {

        switch (value) {
            case 0:
                return "未填写"
            case 1:
                return "是"
            case 2:
                return "否"

        }
    }

    function feedbackBtnFormatter(value, grid, rowes, state) {
        grid.colModel.title = false
        return "<div style='color: #049CE6;display: flex;justify-content: center'>" +
            "<div style='width: 80px;cursor: pointer' title='反馈'class='lookdetail'> <a onclick=showEditView('"+rowes.sysId+"')>反馈 </a></div>" +
            "</div>";
    }




    function showEditView(sysId) {


        loadDialog({
            dialogTitle: '反馈对话框',
            dialogUrl: "/sys/gongjian/jungong/edit/"+sysId,
            dialogFoot: '<button type="button" class="btn btn-primary" onclick="create()">添加</button>' +
                '<button type="button" class="btn btn-pink" onclick="reset()">重置</button>' +
                '<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>'
        });
    }

    function create() {
        executeSaveOrUpdate({
            formId: "#formDialog form",
            dialogId: "#formDialog",
            url: "/sys/gongjian/feedback",
            tableId: "#gridTable",
            successMessage: "反馈成功",
            successTitle: '反馈对话框',
            // failMessage: '保存失败',
            failTitle: '任务反馈结果:'
        });
    }


</script>



</body>
</html>